package com.esp;


import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateMain {
	public static void main(String[] args) throws ClassNotFoundException {
		SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
		Session session = sessionFactory.openSession();
		Contact contact = new Contact();
		contact.setEmail("Abhinav.g55@gmail.com1");
		contact.setFirstName("Abhinav");
		contact.setLastName("Gupta");
		session.save(contact);
		session.flush();
		session.disconnect();
		
	}
}
